home *** CD-ROM | disk | FTP | other *** search
- on init
- Set_ArrowsOn(1, 0)
- Set_ArrowsOn(2, 1)
- SetNumOflines(the number of lines in GetWhichText())
- SetCurrPlace(0)
- if GetNumOflines() > GetMaxLines() then
- SetOptions(GetNumOflines() - GetMaxLines())
- SetIncrement(1.0 * GetSliderHeight() / GetOptions())
- SetTopLoc(the top of sprite GetSliderSprite())
- PlaceSlider()
- set the visible of sprite GetCover_Sprite() to 0
- else
- put GetWhichText() into field "NamesList"
- set the textHeight of field "NamesList" to 14
- set the visible of sprite GetCover_Sprite() to 1
- end if
- initVars()
- set theLocationV to CalcPuppetLoc(1)
- setPuppetLoc(theLocationV, getFldMiddle())
- end
-
- on initScrollOfNames
- if (GetNumOflines() = 1) and (line 1 of GetWhichText() = EMPTY) then
- setPrevLine(0)
- setPuppetLoc(700, 700)
- else
- setPrevLine(1)
- set theLocationV to CalcPuppetLoc(getPrevLine())
- setPuppetLoc(theLocationV, getFldMiddle())
- end if
- end
-
- on initScrollVars
- SetSliderSprite(14)
- setThumbSprite(15)
- setLinePuppetSprite(24)
- SetFieldScroll("NamesList")
- setCover_Sprite(22)
- SetMaxLines(10)
- SetSliderHeight(117)
- setNameDownArrow(12)
- setNameUpArrow(11)
- setFldSprite(20)
- calcFldMiddle()
- end
-
- on checkIfScrollActive
- set the visible of sprite getThumbSprite() to GetNumOflines() > GetMaxLines()
- setSlideEnabled(GetNumOflines() > GetMaxLines())
- return GetNumOflines() > GetMaxLines()
- end
-
- on setSlideEnabled toEnable
- global SlideEnabled
- set SlideEnabled to toEnable
- end
-
- on getSlideEnabled
- global SlideEnabled
- return SlideEnabled
- end
-
- on setCoverSprites coverSprite1, coverSprite2
- global CoverSpriteVec
- set CoverSpriteVec to list()
- repeat with i = 1 to the paramCount
- setAt(CoverSpriteVec, i, param(i))
- set the puppet of sprite param(i) to 1
- end repeat
- end
-
- on handleCoverSprites toshow
- global CoverSpriteVec
- repeat with i = 1 to count(CoverSpriteVec)
- set the visible of sprite integer(getAt(CoverSpriteVec, i)) to not toshow
- end repeat
- updateStage()
- end
-
- on SliderActive
- repeat while the stillDown
- set newV to constrainV(GetSliderSprite(), mouseV())
- set the locV of sprite getThumbSprite() to newV
- set newValue to integer((newV - GetTopLoc()) / GetIncrement())
- SetCurrPlace(newValue)
- put line GetCurrPlace() + 1 to GetCurrPlace() + GetMaxLines() of GetWhichText() into field "NamesList"
- checkHiliteOfFld()
- checkArrows()
- end repeat
- end
-
- on PlaceSlider
- set currentValue to GetCurrPlace()
- set newPlace to GetTopLoc() + integer(GetIncrement() * currentValue)
- set the locV of sprite getThumbSprite() to constrainV(GetSliderSprite(), newPlace)
- put line GetCurrPlace() + 1 to GetCurrPlace() + GetMaxLines() of GetWhichText() into field "NamesList"
- checkHiliteOfFld()
- updateStage()
- end
-
- on ClickSlider toSub
- if not toSub then
- SetCurrPlace(GetCurrPlace() - GetMaxLines() + 1)
- else
- SetCurrPlace(GetCurrPlace() + GetMaxLines() - 1)
- end if
- if GetCurrPlace() < 0 then
- SetCurrPlace(0)
- else
- if (GetCurrPlace() + GetMaxLines()) > GetNumOflines() then
- SetCurrPlace(GetNumOflines() - GetMaxLines())
- end if
- end if
- PlaceSlider()
- checkArrows()
- end
-
- on SetStepMeter direction
- set currentValue to GetCurrPlace()
- if (direction = "increase") and (currentValue <> GetOptions()) then
- SetCurrPlace(currentValue + 1)
- else
- if (direction = "decrease") and (currentValue <> 0) then
- SetCurrPlace(currentValue - 1)
- end if
- end if
- PlaceSlider()
- end
-
- on handleNameUp theSprite
- if get_ArrowsOn(1) then
- set the castNum of sprite theSprite to the number of cast "NameUp_D"
- updateStage()
- NameUp()
- wait(5)
- repeat while the stillDown
- if getName_MoreUp() then
- if rollOver(theSprite) then
- set the castNum of sprite theSprite to the number of cast "NameUp_D"
- updateStage()
- NameUp()
- next repeat
- end if
- set the castNum of sprite theSprite to the number of cast "NameUp"
- updateStage()
- end if
- end repeat
- if getName_MoreUp() then
- set the castNum of sprite theSprite to the number of cast "NameUp"
- updateStage()
- else
- DisableBtn(getNameUpArrow(), "NameUp")
- updateStage()
- end if
- end if
- end
-
- on NameUp
- if (GetCurrPlace() + GetMaxLines()) > GetNumOflines() then
- SetCurrPlace(GetNumOflines() - GetMaxLines())
- end if
- EnableBtn(getNameDownArrow(), "nameDown")
- setName_MoreDown(1)
- if GetCurrPlace() = 1 then
- DisableBtn(getNameUpArrow(), "nameUp")
- setName_MoreUp(0)
- end if
- updateStage()
- SetCurrPlace(GetCurrPlace() - 1)
- PlaceSlider()
- end
-
- on handleNameDown theSprite
- if get_ArrowsOn(2) then
- set the castNum of sprite theSprite to the number of cast "nameDown_D"
- updateStage()
- NameDown()
- wait(5)
- repeat while the stillDown
- if getName_MoreDown() then
- if rollOver(theSprite) then
- set the castNum of sprite theSprite to the number of cast "nameDown_D"
- updateStage()
- NameDown()
- next repeat
- end if
- set the castNum of sprite theSprite to the number of cast "nameDown"
- updateStage()
- end if
- end repeat
- if getName_MoreDown() then
- set the castNum of sprite theSprite to the number of cast "nameDown"
- updateStage()
- else
- DisableBtn(getNameDownArrow(), "nameDown")
- updateStage()
- end if
- end if
- end
-
- on NameDown
- EnableBtn(getNameUpArrow(), "nameUp")
- setName_MoreUp(1)
- if (GetCurrPlace() + 1) >= (GetNumOflines() - GetMaxLines()) then
- DisableBtn(getNameDownArrow(), "nameDown")
- setName_MoreDown(0)
- end if
- updateStage()
- SetCurrPlace(GetCurrPlace() + 1)
- PlaceSlider()
- end
-
- on initVars
- setName_MoreDown(1)
- setName_MoreUp(0)
- EnableBtn(getNameDownArrow(), "nameDown")
- end
-
- on setName_MoreDown bool
- global Name_MoreDown
- set Name_MoreDown to bool
- end
-
- on getName_MoreDown
- global Name_MoreDown
- return Name_MoreDown
- end
-
- on setName_MoreUp bool
- global Name_MoreUp
- set Name_MoreUp to bool
- end
-
- on getName_MoreUp
- global Name_MoreUp
- return Name_MoreUp
- end
-
- on setNameDownArrow bool
- global NameDownArrow
- set NameDownArrow to bool
- end
-
- on getNameDownArrow
- global NameDownArrow
- return NameDownArrow
- end
-
- on setNameUpArrow bool
- global NameUpArrow
- set NameUpArrow to bool
- end
-
- on getNameUpArrow
- global NameUpArrow
- return NameUpArrow
- end
-
- on checkArrows
- if GetCurrPlace() = 0 then
- DisableBtn(getNameUpArrow(), "nameUp")
- setName_MoreUp(0)
- else
- EnableBtn(getNameUpArrow(), "nameUp")
- setName_MoreUp(1)
- end if
- if GetCurrPlace() >= (GetNumOflines() - GetMaxLines()) then
- DisableBtn(getNameDownArrow(), "nameDown")
- setName_MoreDown(0)
- else
- EnableBtn(getNameDownArrow(), "nameDown")
- setName_MoreDown(1)
- end if
- updateStage()
- end
-
- on SetSliderSprite int
- global SliderSprite
- set SliderSprite to int
- end
-
- on GetSliderSprite
- global SliderSprite
- return SliderSprite
- end
-
- on setCover_Sprite int
- global Cover_Sprite
- set Cover_Sprite to int
- end
-
- on GetCover_Sprite
- global Cover_Sprite
- return Cover_Sprite
- end
-
- on setThumbSprite int
- global ThumbSprite
- set ThumbSprite to int
- end
-
- on getThumbSprite
- global ThumbSprite
- return ThumbSprite
- end
-
- on SetCurrPlace int
- global CurrPlace
- set CurrPlace to int
- end
-
- on GetCurrPlace
- global CurrPlace
- return CurrPlace
- end
-
- on SetSliderHeight int
- global SliderHeight
- set SliderHeight to int
- end
-
- on GetSliderHeight
- global SliderHeight
- return SliderHeight
- end
-
- on SetIncrement int
- global Increment
- set Increment to int
- end
-
- on GetIncrement
- global Increment
- return Increment
- end
-
- on SetTopLoc int
- global TopLoc
- set TopLoc to int
- end
-
- on GetTopLoc
- global TopLoc
- return TopLoc
- end
-
- on SetOptions int
- global options
- set options to int
- end
-
- on GetOptions
- global options
- return options
- end
-
- on SetMaxLines int
- global MaxLines
- set MaxLines to int
- end
-
- on GetMaxLines
- global MaxLines
- return MaxLines
- end
-
- on SetFieldScroll int
- global FieldScroll
- set FieldScroll to int
- end
-
- on GetFieldScroll
- global FieldScroll
- return FieldScroll
- end
-
- on SetNumOflines int
- global numOfLines
- set numOfLines to int
- end
-
- on GetNumOflines
- global numOfLines
- return numOfLines
- end
-
- on wait int
- set startTime to the ticks
- repeat while (the ticks - startTime) < int
- end repeat
- end
-
- on clickScrollFld
- set locH to getAt(the clickLoc, 1)
- set locV to getAt(the clickLoc, 2)
- set RelativeV to integer(locV - the top of sprite getFldSprite())
- set theLine to integer((RelativeV / 14) + 1)
- if line theLine of field "NamesList" <> EMPTY then
- set theLocationV to CalcPuppetLoc(theLine)
- setPuppetLoc(theLocationV, getFldMiddle())
- putLineInFld(theLine)
- end if
- end
-
- on CalcPuppetLoc lineToPuppet
- return (14 * (lineToPuppet - 1)) + 6 + the top of sprite getFldSprite()
- end
-
- on setPuppetLoc theLocationV, theLocationH
- set the locV of sprite getLinePuppetSprite() to theLocationV
- end
-
- on putLineInFld theLine
- setPrevLine(GetCurrPlace() + theLine)
- updateStage()
- end
-
- on checkHiliteOfFld
- if getPrevLine() <> 0 then
- set lineNumber to getPrevLine()
- if (lineNumber > GetCurrPlace()) and (lineNumber < (GetCurrPlace() + GetMaxLines() + 1)) then
- setPuppetLoc(CalcPuppetLoc(lineNumber - GetCurrPlace()), getFldMiddle())
- else
- setPuppetLoc(700, 700)
- end if
- updateStage()
- end if
- end
-
- on calcFldMiddle
- global FldMiddle
- set FldMiddle to the left of sprite getFldSprite() + (the width of sprite getFldSprite() / 2)
- end
-
- on getFldMiddle
- global FldMiddle
- return FldMiddle
- end
-
- on setFldSprite int
- global FldSprite
- set FldSprite to int
- end
-
- on getFldSprite
- global FldSprite
- return integer(FldSprite)
- end
-
- on setLinePuppetSprite int
- global LinePuppetSprite
- set LinePuppetSprite to int
- end
-
- on getLinePuppetSprite
- global LinePuppetSprite
- return integer(LinePuppetSprite)
- end
-
- on setPrevLine int
- global PrevLine
- set PrevLine to int
- end
-
- on getPrevLine
- global PrevLine
- return PrevLine
- end
-
- on deleteLineFromFld
- global WhichText
- set lineToDelete to getPrevLine()
- if lineToDelete > 0 then
- DeleteLIST(line lineToDelete of WhichText)
- deleteWhichText(lineToDelete)
- put WhichText into field "complete"
- SaveIndexFile()
- setPrevLine(0)
- setPuppetLoc(700, 700)
- reInit()
- end if
- updateStage()
- end
-
- on deleteWhichText theLine
- global WhichText
- delete line theLine of WhichText
- end
-
- on reInit
- SetNumOflines(the number of lines in GetWhichText())
- if GetMaxLines() <= (GetNumOflines() - 1) then
- if (GetCurrPlace() + GetMaxLines()) <= GetNumOflines() then
- SetOptions(GetNumOflines() - GetMaxLines())
- SetIncrement(1.0 * GetSliderHeight() / GetOptions())
- PlaceSlider()
- checkArrows()
- else
- SetOptions(GetNumOflines() - GetMaxLines())
- SetIncrement(1.0 * GetSliderHeight() / GetOptions())
- checkArrows()
- put line GetCurrPlace() + 1 to GetCurrPlace() + GetMaxLines() of GetWhichText() into field GetFieldScroll()
- checkHiliteOfFld()
- end if
- else
- SetCurrPlace(0)
- put GetWhichText() into field GetFieldScroll()
- set the visible of sprite GetCover_Sprite() to 1
- end if
- handleScrollCursors(checkIfScrollActive())
- end
-
- on handleScrollCursors bool
- if bool then
- UpdateCursors(getNameDownArrow(), 3)
- UpdateCursors(getNameUpArrow(), 3)
- UpdateCursors(GetSliderSprite(), 3)
- else
- UpdateCursors(getNameDownArrow(), 1)
- UpdateCursors(getNameUpArrow(), 1)
- UpdateCursors(GetSliderSprite(), 1)
- end if
- end
-